import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class MyJob implements Job {
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //JobExecutionContext 可获取 JobDetail和Trigger 对象，并获取通过usingJobData方法设置的参数
        System.out.print("my job（" + Thread.currentThread().getName() + "）：");
        //
        if (false) throw new RuntimeException("自定义错误");
        //
        if (true) sleep(6000);
        System.out.println("Job Done : " + Thread.currentThread().getName());
    }



    private void sleep(long ms){
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}